#pragma once

#include <vector>

typedef unsigned long Argb;
typedef unsigned __int64 Argb64;

enum blendMode
{
	notXorPenBlend = 0xf000
};
//enum colorMode
//{
//	ColorModeARGB32 = 0,
//	ColorModeARGB64 = 1
//};
//
//enum ColorChannelFlags
//{
//	ColorChannelFlagsC = 0,
//	ColorChannelFlagsM,
//	ColorChannelFlagsY,
//	ColorChannelFlagsK,
//	ColorChannelFlagsLast
//};

class Color
{
public:
	enum
	{
		AliceBlue            = 0xFFF0F8FFu,
		AntiqueWhite         = 0xFFFAEBD7u,
		Aqua                 = 0xFF00FFFFu,
		Aquamarine           = 0xFF7FFFD4u,
		Azure                = 0xFFF0FFFFu,
		Beige                = 0xFFF5F5DCu,
		Bisque               = 0xFFFFE4C4u,
		Black                = 0xFF000000u,
		BlanchedAlmond       = 0xFFFFEBCDu,
		Blue                 = 0xFF0000FFu,
		BlueViolet           = 0xFF8A2BE2u,
		Brown                = 0xFFA52A2Au,
		BurlyWood            = 0xFFDEB887u,
		CadetBlue            = 0xFF5F9EA0u,
		Chartreuse           = 0xFF7FFF00u,
		Chocolate            = 0xFFD2691Eu,
		Coral                = 0xFFFF7F50u,
		CornflowerBlue       = 0xFF6495EDu,
		Cornsilk             = 0xFFFFF8DCu,
		Crimson              = 0xFFDC143Cu,
		Cyan                 = 0xFF00FFFFu,
		DarkBlue             = 0xFF00008Bu,
		DarkCyan             = 0xFF008B8Bu,
		DarkGoldenrod        = 0xFFB8860Bu,
		DarkGray             = 0xFFA9A9A9u,
		DarkGreen            = 0xFF006400u,
		DarkKhaki            = 0xFFBDB76Bu,
		DarkMagenta          = 0xFF8B008Bu,
		DarkOliveGreen       = 0xFF556B2Fu,
		DarkOrange           = 0xFFFF8C00u,
		DarkOrchid           = 0xFF9932CCu,
		DarkRed              = 0xFF8B0000u,
		DarkSalmon           = 0xFFE9967Au,
		DarkSeaGreen         = 0xFF8FBC8Bu,
		DarkSlateBlue        = 0xFF483D8Bu,
		DarkSlateGray        = 0xFF2F4F4Fu,
		DarkTurquoise        = 0xFF00CED1u,
		DarkViolet           = 0xFF9400D3u,
		DeepPink             = 0xFFFF1493u,
		DeepSkyBlue          = 0xFF00BFFFu,
		DimGray              = 0xFF696969u,
		DodgerBlue           = 0xFF1E90FFu,
		Firebrick            = 0xFFB22222u,
		FloralWhite          = 0xFFFFFAF0u,
		ForestGreen          = 0xFF228B22u,
		Fuchsia              = 0xFFFF00FFu,
		Gainsboro            = 0xFFDCDCDCu,
		GhostWhite           = 0xFFF8F8FFu,
		Gold                 = 0xFFFFD700u,
		Goldenrod            = 0xFFDAA520u,
		Gray                 = 0xFF808080u,
		Green                = 0xFF008000u,
		GreenYellow          = 0xFFADFF2Fu,
		Honeydew             = 0xFFF0FFF0u,
		HotPink              = 0xFFFF69B4u,
		IndianRed            = 0xFFCD5C5Cu,
		Indigo               = 0xFF4B0082u,
		Ivory                = 0xFFFFFFF0u,
		Khaki                = 0xFFF0E68Cu,
		Lavender             = 0xFFE6E6FAu,
		LavenderBlush        = 0xFFFFF0F5u,
		LawnGreen            = 0xFF7CFC00u,
		LemonChiffon         = 0xFFFFFACDu,
		LightBlue            = 0xFFADD8E6u,
		LightCoral           = 0xFFF08080u,
		LightCyan            = 0xFFE0FFFFu,
		LightGoldenrodYellow = 0xFFFAFAD2u,
		LightGray            = 0xFFD3D3D3u,
		LightGreen           = 0xFF90EE90u,
		LightPink            = 0xFFFFB6C1u,
		LightSalmon          = 0xFFFFA07Au,
		LightSeaGreen        = 0xFF20B2AAu,
		LightSkyBlue         = 0xFF87CEFAu,
		LightSlateGray       = 0xFF778899u,
		LightSteelBlue       = 0xFFB0C4DEu,
		LightYellow          = 0xFFFFFFE0u,
		Lime                 = 0xFF00FF00u,
		LimeGreen            = 0xFF32CD32u,
		Linen                = 0xFFFAF0E6u,
		Magenta              = 0xFFFF00FFu,
		Maroon               = 0xFF800000u,
		MediumAquamarine     = 0xFF66CDAAu,
		MediumBlue           = 0xFF0000CDu,
		MediumOrchid         = 0xFFBA55D3u,
		MediumPurple         = 0xFF9370DBu,
		MediumSeaGreen       = 0xFF3CB371u,
		MediumSlateBlue      = 0xFF7B68EEu,
		MediumSpringGreen    = 0xFF00FA9Au,
		MediumTurquoise      = 0xFF48D1CCu,
		MediumVioletRed      = 0xFFC71585u,
		MidnightBlue         = 0xFF191970u,
		MintCream            = 0xFFF5FFFAu,
		MistyRose            = 0xFFFFE4E1u,
		Moccasin             = 0xFFFFE4B5u,
		NavajoWhite          = 0xFFFFDEADu,
		Navy                 = 0xFF000080u,
		OldLace              = 0xFFFDF5E6u,
		Olive                = 0xFF808000u,
		OliveDrab            = 0xFF6B8E23u,
		Orange               = 0xFFFFA500u,
		OrangeRed            = 0xFFFF4500u,
		Orchid               = 0xFFDA70D6u,
		PaleGoldenrod        = 0xFFEEE8AA,
		PaleGreen            = 0xFF98FB98,
		PaleTurquoise        = 0xFFAFEEEE,
		PaleVioletRed        = 0xFFDB7093,
		PapayaWhip           = 0xFFFFEFD5,
		PeachPuff            = 0xFFFFDAB9,
		Peru                 = 0xFFCD853F,
		Pink                 = 0xFFFFC0CB,
		Plum                 = 0xFFDDA0DD,
		PowderBlue           = 0xFFB0E0E6,
		Purple               = 0xFF800080,
		Red                  = 0xFFFF0000,
		RosyBrown            = 0xFFBC8F8F,
		RoyalBlue            = 0xFF4169E1,
		SaddleBrown          = 0xFF8B4513,
		Salmon               = 0xFFFA8072,
		SandyBrown           = 0xFFF4A460,
		SeaGreen             = 0xFF2E8B57,
		SeaShell             = 0xFFFFF5EE,
		Sienna               = 0xFFA0522D,
		Silver               = 0xFFC0C0C0,
		SkyBlue              = 0xFF87CEEB,
		SlateBlue            = 0xFF6A5ACD,
		SlateGray            = 0xFF708090,
		Snow                 = 0xFFFFFAFA,
		SpringGreen          = 0xFF00FF7F,
		SteelBlue            = 0xFF4682B4,
		Tan                  = 0xFFD2B48C,
		Teal                 = 0xFF008080,
		Thistle              = 0xFFD8BFD8,
		Tomato               = 0xFFFF6347,
		Transparent          = 0x00FFFFFF,
		Turquoise            = 0xFF40E0D0,
		Violet               = 0xFFEE82EE,
		Wheat                = 0xFFF5DEB3,
		White                = 0xFFFFFFFF,
		WhiteSmoke           = 0xFFF5F5F5,
		Yellow               = 0xFFFFFF00,
		YellowGreen          = 0xFF9ACD32
	};

	enum
	{
		AlphaShift  = 24,
		RedShift    = 16,
		GreenShift  = 8,
		BlueShift   = 0
	};

	enum
	{
		AlphaMask   = 0xff000000,
		RedMask     = 0x00ff0000,
		GreenMask   = 0x0000ff00,
		BlueMask    = 0x000000ff
	};
	static Argb MakeARGB(BYTE a,BYTE r,BYTE g,BYTE b)
	{
		return (((Argb) (b) <<  BlueShift) | ((Argb) (g) << GreenShift) | ((Argb) (r) <<   RedShift) | ((Argb) (a) << AlphaShift));
	}

public:

	Color()
	{
		m_argb = (Argb)Color::Black;
	}

	Color(BYTE r,BYTE g,BYTE b)
	{
		m_argb = MakeARGB(255, r, g, b);
	}

	Color(BYTE a,BYTE r,BYTE g,BYTE b)
	{
		m_argb = MakeARGB(a, r, g, b);
	}

	Color(Argb argb)
	{
		m_argb = argb;
	}

	BYTE GetAlpha() const
	{
		return (BYTE) (m_argb >> AlphaShift);
	}

	BYTE GetA() const
	{
		return GetAlpha();
	}

	BYTE GetRed() const
	{
		return (BYTE) (m_argb >> RedShift);
	}

	BYTE GetR() const
	{
		return GetRed();
	}

	BYTE GetGreen() const
	{
		return (BYTE) (m_argb >> GreenShift);
	}

	BYTE GetG() const
	{
		return GetGreen();
	}

	BYTE GetBlue() const
	{
		return (BYTE) (m_argb >> BlueShift);
	}

	BYTE GetB() const
	{
		return GetBlue();
	}

	Argb GetValue() const
	{
		return m_argb;
	}

	void SetValue(Argb argb)
	{
		m_argb = argb;
	}

protected:
	Argb m_argb;
};

typedef std::vector<Color> Colors;